package com.wyc.example.dao;

import com.wyc.example.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author 王韫琛
 * @version 1.0
 * @date 2021/5/23 8:45
 */
@Repository
public interface UserDao extends JpaRepository<User,Long> {
    @Query(value = "select * from user where name like %?1%", nativeQuery = true)
    Page<User> findNameLike(String name, Pageable request);
}
